﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VelesPresentation;
using VelesDBCore;


namespace VelesUIWinForm
{
    public partial class Form1 : Form,ICategoryView
    {
        CategoryPresenter presenter;
        List<Category> categories;

        public Form1()
        {
            InitializeComponent();
            presenter = new CategoryPresenter(this);
        }

        #region Члены ICategoryView

        public event VoidEventHandler FindCategory;

        public List<Category> Categories
        {
            get
            {
                return categories;
            }
            set
            {
                categories = value;
            }
        }

        #endregion

        #region Члены IView

        public event VoidEventHandler PrepareView;

        #endregion

        private void button1_Click(object sender, EventArgs e)
        {
            if (FindCategory != null) FindCategory();
            dataGridView1.DataSource = categories;
        }
    }
}
